<template>
	<view>
		<navbar title="历史记录"></navbar>
		<view class="record-box">
			<view class="record-list" v-for="(item, index) in list" :key="index">
				<view class="title">{{item.content}}</view>
				<view class="images flex fww">
					<image class="image" :src="row" mode="" v-for="(row, col) in item.img" :key="col" @click="utils.previewImage(item.img, col)"></image>
				</view>
				<view class="time-box fa jcsb">
					<view>{{item.createTime}}</view>
					<view v-if="item.feedback != null">已完结</view>
					<view class="state2" v-if="item.feedback == null">待反馈</view>
				</view>
				<view class="reply-box" v-if="item.feedback != null">
					<view class="content">{{item.feedback}}</view>
					<view class="time-box">{{item.updateTime}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page: 1,
				count: 0,
				list: []
			};
		},
		onLoad() {
			this.getRecord()
		},
		methods: {
			getRecord() {
				this.api.feedbackRecordFunc().then(res => {
					if(res.code == 200) {
						this.count = res.total
						this.list = this.page == 1 ? res.rows : this.list.concat(res.rows)
						this.list.forEach(item => {
							if(item.img != null) {
								item.img = item.img.split(',')
							}
						})
						console.log(this.list)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.record-box{
		padding: 20rpx 24rpx 10rpx;
		.record-list{
			margin-bottom: 20rpx;
			padding: 28rpx 24rpx;
			border-radius: 10rpx;
			background-color: #fff;
			.title{
				font-size: 30rpx;
				font-weight: bold;
				color: #252729;
				line-height: 40rpx;
			}
			.images{
				margin-top: 8rpx;
				.image{
					margin-top: 10rpx;
					margin-right: 10rpx;
					width: 148rpx;
					height: 148rpx;
					border-radius: 10rpx;
				}
			}
			.time-box{
				margin-top: 18rpx;
				font-size: 24rpx;
				color: #ccc;
				.state2{
					color: #FF7227;
				}
			}
			.reply-box{
				margin-top: 28rpx;
				padding-top: 28rpx;
				border-top: 2rpx solid #F1F1F1;
				.content{
					font-size: 30rpx;
					font-weight: bold;
					color: #999EA9;
				}
			}
		}
	}
</style>
